package com.yhzhou.test;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@Path("/hello")
public class Hello {
    // This method is called if TEXT_PLAIN is request
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String sayPlainTextHello() {

        return "Hello Jersey123";
    }
    // This method is called if XML is request
    @GET
    @Produces(MediaType.TEXT_XML)
    public String sayXMLHello() {
        return "<?xml version=\"1.0\"?>" + "<hello> Hello Jersey2" + "</hello>";
    }
    // This method is called if HTML is request
    @GET
    @Produces(MediaType.TEXT_HTML)
    public String sayHtmlHello() {
        String app = "com.tencent.mm";
        test test2 = new test();
        test.main2(app);
        return "<html> " + "<title>" + "Hello Jersey1" + "</title>"
                + "<body><h1>" + "Hello Jersey2" + "</body></h1>" + "</html> ";
    }
}

